.TH WRITE 2 
.SH NAME
write \- write on a file
.SH SYNOPSIS
.B write(fildes, buffer, nbytes)
.br
.B char *buffer;
.SH DESCRIPTION
A file descriptor is a word returned from a
successful
.I open,
.I creat,
.I dup,
or
.IR pipe (2)
call.
.PP
.I Buffer
is the address of
.I nbytes
contiguous
bytes which are written on the output file.
The number of characters actually written is returned.
It should be regarded as an error
if this is not the same as requested.
.PP
Writes which are multiples
of 512 characters long and begin on a 512-byte boundary
in the file
are more efficient than any others.
.SH "SEE ALSO"
creat(2), open(2), pipe(2)
.SH DIAGNOSTICS
Returns
\-1 on error: bad descriptor, buffer address, or
count; physical I/O errors.
.SH ASSEMBLER
(write = 4.)
.br
(file descriptor in r0)
.br
.B sys  write; buffer; nbytes
.br
(byte count in r0)
